package com.avengers.core.bean.enums;

/**
 * @author wy
 * @since 11:15 2018/7/12
 */
public enum RegistrarCode {
    // 17EX
    _17EX(true, false, false, "17EX"),
    // cnnic
    ynld(true, true, true, "云南蓝队"),
    cnet(true, true, true, "网路中文"),
    tjzr(true, true, true, "天津追日"),
    zyzk(true, true, true, "中域智科"),
    qxwl(true, true, false, "千喜网络"),
    yiso(true, true, true, "北部湾"),
    zksf(true, true, true, "中科三方"),
    wbcc(true, true, true, "webNic"),
    bjzh(true, true, true, "北京资海"),
    hqhy(true, true, true, "环球互易"),
    huyi(true, true, true, "广东互易"),
    youq(true, true, true, "宁夏友情"),
    bjzy(true, true, true, "北京中域"),
    nih(true, true, true, "万维通港"),
    hmjd(true, true, true, "海南美洁达"),
    xjny(true, true, true, "新疆诺云"),
    ynhd(true, true, true, "互道云"),
    dfwj(true, true, true, "东方网景"),
    cqzj(true, true, true, "重庆智佳"),
    wjpp(true, true, true, "网聚品牌"),
    xinnet(true, true, false, "新网"),
    cne(true, true, false, "中企动力"),
    // cnnic 非抢注
    cert(true, true, true, "赛尔网络"),
    bjwz(true, true, true, "北京网尊"),
    brma(true, true, false, "中域网路"),
    sjcl(true, true, false, "世纪创联"),
    cdns(true, true, false, "微创网络"),
    ys23(true, true, true, "北部湾"),
    yq23(true, true, true, "宁夏友情"),
    hhkj(true, true, true, "互合科技"),
    // verisign
    hzbest(true, false, true, "Domain Best"),
    sksat(true, false, false, "sksat"),
    zheng(true, false, false, "zheng"),
    zhengbus(true, false, false, "zhengbus"),
    shenzhen(true, false, false, "shenzhen"),
    ehost(true, false, false, "ehost"),
    doinse(true, false, false, "域名国际"),
    weichuang(true, false, false, "河南微创"),
    trebj(true, false, true, "IPIP Inc."),
    seventd(true, false, true, "17domain"),
    dom1lim(true, false, true, "17domain1"),
    dom2lim(true, false, true, "17domain2"),
    dom3lim(true, false, true, "17domain3"),
    dom4lim(true, false, true, "17domain4"),
    // other
    hm(false, true, false, "怀米网络"),
    _66(false, true, false, "66国域"),
    _22(false, true, false, "爱名网"),
    eName(false, true, false, "易名"),
    ymc(false, true, false, "域名城"),
    naWang(false, true, false, "纳网"),
    juMing(false, true, false, "聚名"),
    west(false, true, false, "西部数码"),
    zzy(false, true, false, "中资源"),
    bizCn(false, true, false, "商务中国"),
    aliyun(false, true, false, "阿里云"),
    aliWZ(false, true, false, "阿里云"),
    aliGD(false, true, false, "阿里云"),
    tencent(false, true, false, "腾讯云"),
    dynaDot(false, true, false, "DynaDot"),
    xinWang(false, true, false, "新网"),
    _190(false, true, false, "190"),
    snapNames(false, false, false, "SnapNames"),
    dropCatch(false, false, false, "DropCatch"),
    nameCheap(false, false, false, "NameCheap"),
    thirdPlatform(false, false, false, "第三方"),
    goDaddy(false, false, false, "GoDaddy"),
    afterNic(false, false, false, "afterNic"),
    nameJet(false, false, false, "NameJet"),
    namesLink(false, false, false, "NamesLink"),

    EL_17(false, false, false, "17EX外部"),
    _8658(false, false, false, "8658");

    public final boolean isOwn;
    public final boolean isNeedVsp;
    public final boolean hasPassword;
    public final String comment;

    RegistrarCode(boolean isOwn, boolean isNeedVsp, boolean hasPassword, String comment) {
        this.isOwn = isOwn;
        this.isNeedVsp = isNeedVsp;
        this.hasPassword = hasPassword;
        this.comment = comment;
    }

    public static RegistrarCode of(String str) {
        for (RegistrarCode registrarCode : values()) {
            if (registrarCode.name().equalsIgnoreCase(str)) {
                return registrarCode;
            }
        }
        return null;
    }

    public static boolean isAli(RegistrarCode registrar) {
        return RegistrarCode.aliyun.equals(registrar) || RegistrarCode.aliWZ.equals(registrar);
    }

    public static boolean isAli(String registrar) {
        return RegistrarCode.aliyun.name().equals(registrar) || RegistrarCode.aliWZ.name().equals(registrar);
    }
}